package com.bckj.fastboot.paid.biz.application.service;

import com.bckj.fastboot.paid.api.model.RefundRequest;
import com.bckj.fastboot.paid.api.model.RefundResponse;
import com.bckj.fastboot.paid.biz.domain.refund.context.RefundContext;
import com.bckj.fastboot.paid.biz.domain.refund.service.RefundOrderDomainService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class RefundService {

    private final RefundOrderDomainService refundOrderDomainService;

    public RefundResponse refund(RefundRequest request) {
        RefundContext ctx = RefundContext.create();
        ctx.setRequest(request);
        refundOrderDomainService.refund(ctx);
        return ctx.getResponse();
    }
}
